import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    meta: {title: '首页',},
    component: () => import('../views/home.vue'),
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {title: '首页',},
        component: () => import('../views/index/index.vue'),
      },
      {
        path: '/project',
        name: 'project',
        meta: {title: '服务',},
        component: () => import('../views/projectList/projectList.vue')
      },
      {
        path: '/contact',
        name: 'contact',
        meta: {title: '联系我们',},
        component: () => import('../views/contact/contact.vue')
      },
      {
        path: '/environmen',
        name: 'environmen',
        meta: {title: '办公环境',},
        component: () => import('../views/environmen/environmen.vue')
      },
      {
        path: '/aboutUs',
        name: 'aboutUs',
        meta: {title: '关于我们',},
        component: () => import('../views/aboutUs/aboutUs.vue')
      },
      {
        path: '/problem',
        name: 'problem',
        meta: {title: '问题详情',},
        component: () => import('../views/problem/problem.vue')
      },
      {
        path: '/problemlist',
        name: 'problemlist',
        meta: {title: '问题列表',},
        component: () => import('../views/problemList/problemList.vue')
      },
      {
        path: '/consult',
        name: 'consult',
        meta: {title: '搜索咨询',},
        component: () => import('../views/consult/consult.vue')
      },
      {
        path: '/contentInfo',
        name: 'contentInfo',
        meta: {title: '详情',},
        component: () => import('../views/contentInfo/contentInfo.vue')
      },
      {

        path: '/business',
        name: 'business',
        meta: {title: '商学院',},
        component: () => import('../views/business/business.vue')
      },
      {
        path: '/news',
        name: 'news',
        meta: {title: '新闻资讯',},
        component: () => import('../views/news/news.vue')
      },
      {
        path: '/newsInfo',
        name: 'newsInfo',
        meta: {title: '新闻资讯详情',},
        component: () => import('../views/newInfo/newInfo.vue')
      },
      {
        path: '/businessInfo',
        name: 'businessInfo',
        meta: {title: '商学院详情',},
        component: () => import('../views/businessInfo/businessInfo.vue')
      },
      {
        path: '/user',
        name: 'user',
        meta: {title: '个人中心',},
        component: () => import('../views/user/index.vue')

      },
    ]
  },


]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  scrollBehavior: () => ({
    y: 0
  }),
  routes
})

export default router
